// by Jens Schmidt 2009
// for: YOU
// use, modify, copy this as you like

function PreferencesAssistant(aSettings) {
	  this.settings=aSettings;
}

PreferencesAssistant.prototype.setup = function() {
	this.controller.setupWidget("userName",
         this.attributes = {
             hintText: $L('your account login name'),
             multiline: false,
             enterSubmits: false,
             focus: true,
			 focusMode: Mojo.Widget.focusSelectMode,
			 maxLength: 30,
			 width: 125
         },
         this.model = {
             value: this.settings.Name,
             disabled: false
    });
	
	this.controller.setupWidget("pass",
         this.attributes = {
             hintText: $L('Type Password'),
             multiline: false,
             enterSubmits: false,
			 focusMode: Mojo.Widget.focusSelectMode,
			 maxLength: 32,
			 width: 125
         },
         this.model = {
             value: this.settings.Pass
    });

	this.controller.setupWidget(Mojo.Menu.appMenu,
       	this.attributes = {
                omitDefaultItems: true
            },
    	this.model = {
        visible: true,
        items: [Mojo.Menu.editItem]
		});
}

PreferencesAssistant.prototype.activate = function(event) {
}


PreferencesAssistant.prototype.deactivate = function(event) {
}

PreferencesAssistant.prototype.cleanup = function(event) {
    this.settings.loginSet(this.controller.get("userName").mojo.getValue(),this.controller.get("pass").mojo.getValue());
}
